package com.woniuxy.main.service.imp;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniuxy.main.mapper.CoachMapper;
import com.woniuxy.main.pojo.Coach;
import com.woniuxy.main.pojo.Student_coach;
import com.woniuxy.main.pojo.Vi_coachOrder_studentInfo;
import com.woniuxy.main.service.CoachService;

import lombok.Data;

@Data
@Service
@Transactional
public class CoachServiceImp implements CoachService{
	
	@Resource
	private CoachMapper coachMapper;
	
	@Override	//查询教练收费
	public double coachPrice(int cid) {
		return coachMapper.coachPrice(cid);
	}

	@Override	//查询多个Student_coach信息
	public List<Student_coach> findAllContract(int currentCid) {
		return coachMapper.findAllContract(currentCid);
	}

	@Override
	public List<Vi_coachOrder_studentInfo> showMyStudentList(Map<String, Object> request) {
		return coachMapper.showMyStudentList(request);
	}

	@Override
	public int myStudentTotalCount(int uid) {
		return coachMapper.myStudentTotalCount(uid);
	}

	@Override	//修改状态
	public int alterStatus(Student_coach sc) {
		return coachMapper.alterStatus(sc);
	}
	
	@Override
	public int updateCoach(Coach coach) {
		return coachMapper.updateCoach(coach);
	}

	@Override
	public int insertCoach(int uid) {
		
		return coachMapper.insertCoach(uid);
	}

	@Override
	public Coach selectByUid(int uid) {
		
		return coachMapper.selectByUid(uid);
	}

	@Override
	public int adminAdd(Coach coach) {
		return coachMapper.adminAdd(coach);
	}

	@Override
	public int searchPriceByCid(int cid) {
		// TODO Auto-generated method stub
		return coachMapper.searchPriceByCid(cid);
	}
}
